Learn R Programming

Directional (version 5.3)

Haversine distance matrix: Harvesine distance matrix

Description

Haversine distance matrix.

Usage

haversine.dist(x)

Arguments

x

A a matrix of two columns. The first column is the latitude and the second the longitude.

Value

A matrix with the haversine distances between all observations.

Details

The function computes the haversine distance between all observations.

References

https://en.wikipedia.org/wiki/Haversine_formula

See Also

cosnn, dirknn

Examples

Run this code
# NOT RUN {
x <- rvmf(10, rnorm(3), 10)
x <- euclid.inv(x)
haversine.dist(x)
# }

Run the code above in your browser using DataLab